/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2019-2019.
 * Description: fiq_routeway_register.h
 * Author: xiaojiangfeng <xiaojiangfeng@huawei.com>
 * Create: 2019-01-04
 */

#ifndef __FIQ_ROUTEWAY_REGISTER_H
#define __FIQ_ROUTEWAY_REGISTER_H

#include <linux/printk.h>
#include <linux/of.h>

#define fiq_glue_log_and_return_if(cond, ret, fmt, args...) do {	\
	if (cond) {							\
		pr_err(fmt" ret %d\n", ##args, ret);			\
		return ret;						\
	}								\
} while (0)

#define FIQ_GLUE_NUM_MAX 16
struct fiq_glue_no_info {
	unsigned int fiq_num;
	unsigned int fiq_no[FIQ_GLUE_NUM_MAX];
};

enum fiq_glue_int_param {
	FIQ_HANDLE_MODEL = 0,
	FIQ_NO,
	TRIGGER_MODE,
	FIQ_GLUE_INT_PARAM_MAX,
};

struct fiq_glue_reg_cfg {
	void __iomem *addr;
	unsigned int mask;
	unsigned int val;
};

int fiq_default_init(void);

uint32_t fiq_glue_no_translate(uint32_t *params);

extern struct fiq_glue_no_info g_fiq_glue_no_info;

int fiq_glue_parse_source_common(const char *string);
int fiq_glue_parse_type_common(const char *string);

#endif /* __FIQ_ROUTEWAY_REGISTER_H */
